package com.utils;

/**
 * Created by 再壮 on 2018/6/9.
 */
public final class Constants {
    /**
     * 返回通用状态码
     */
    public static interface RESPON_CODE{
        public static String SUCCESS="000000";
        public static String ERROR="999999";
    }

    /**
     * 资产状态信息
    * Title: ASSET_INFO_STATUS
    * Description:
    * @author    BaiBing
    * @date      2018年6月20日
     */
    public static enum ASSET_INFO_STATUS{
    	
//    	Scrap("0","报废"),Inlibrary("1","在库"),InCar("2","在车"),InWash("3","洗涤");
        InCar("0","在车"),Duan("1","段"),InWash("2","洗涤"),Inlibrary("3","在库"),Scrap("9","报废");

    	ASSET_INFO_STATUS(String status,String name){
    		this.status = status;
    		this.name = name;
    	}
    	
    	private final String status;
    	private final String name;
    	
    	public String getStatus(){
    		return status;
    	}
    	
    	public String getName(){
    		return name;
    	}

        public static ASSET_INFO_STATUS codeOf(String code){
            for(ASSET_INFO_STATUS assetStatus : values()){
                if(assetStatus.getStatus() .equals(code) ){
                    return assetStatus;
                }
            }
            throw new RuntimeException("么有找到对应的枚举");
        }
    }
    
    /**
     * 角色类型
     */
    public static interface ROLE_TYPE{
    	public static String WEB_ROLE = "1";
    	public static String MOBILE_ROLE = "2";
    }
    
    /**
     * 模块平台
     */
    public static interface MODULE_PLATFORM{
    	public static String WEB_MODULE = "1";
    	public static String MODULE_MODULE = "2";
    }
    
    /**
     * 异常码定义
     */
    public enum ErrorMessage{
    	
    	
    	RETCODE0000001("0000001", "账户不存在！"),
    	RETCODE0000002("0000002", "密码不正确！"),
    	RETCODE0000003("0000003", "用户名或密码不能为空！"),
    	RETCODE0000004("0000004", "账户已锁定！"),
    	RETCODE0000005("0000005", "请您先去登录！"),
		RETCODE0000006("0000006", "备品入库单上传校验数据失败！");
    	
    	
		private String retCode;
		private String retMsg;
		
		private ErrorMessage(String retCode, String retMsg) {
			this.retCode = retCode;
			this.retMsg = retMsg;
		}
		public String getRetCode() {
			return retCode;
		}

		public void setRetCode(String retCode) {
			this.retCode = retCode;
		}

		public String getRetMsg() {
			return retMsg;
		}
		public void setRetMsg(String retMsg) {
			this.retMsg = retMsg;
		}
		
    }
    
    /**
     * 组织类型
    * Title: ORGANIZER_TYPE
    * Description:
    * @author    BaiBing
    * @date      2018年6月30日
     */
    public interface ORGANIZER_TYPE{
    	public Integer Train = 0;//火车
    	public Integer Paragraph = 1;//段
    	public Integer Washing  = 2;//洗涤厂
    	public Integer Storage = 3;//库
    }

	/**
	 * 组织类型
	 */
	public static enum ORGANIZER_TYPE_enum{

		Train("0","火车"),Paragraph("1","段"),Washing("2","洗涤厂"),Storage("3","库");

		ORGANIZER_TYPE_enum(String type,String name){
			this.type = type;
			this.name = name;
		}

		private final String type;
		private final String name;

		public String getType(){
			return type;
		}

		public String getName(){
			return name;
		}

		public static ORGANIZER_TYPE_enum codeOf(String type){
			for(ORGANIZER_TYPE_enum organizerType : values()){
				if(organizerType.getType() .equals(type) ){
					return organizerType;
				}
			}
			throw new RuntimeException("么有找到对应的枚举");
		}
	}
}
